home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / aie9003.zip / XOR2.ARI < prev   
Text File  |  1989-12-28  |  2KB  |  113 lines

  1.  
  2. %%%%%%%%%%%% training data for exclusive or %%%%%%%%%%%%%%%%%%%%%%%%%
  3.  
  4.  
  5. number_data_items( 16 ).
  6.  
  7. input(  0  , 1, 0 ).
  8. input(  0  , 2, 0 ).
  9.  
  10. input(  1  , 1, 1 ).
  11. input(  1  , 2, 1 ).
  12.  
  13. input(  2  , 1, 1 ).
  14. input(  2  , 2, 0 ).
  15.  
  16. input(  3  , 1, 0 ).
  17. input(  3  , 2, 1 ).
  18.  
  19. input(  4  , 1, 0 ).
  20. input(  4  , 2, 0 ).
  21.  
  22. input(  5  , 1, 1 ).
  23. input(  5  , 2, 1 ).
  24.  
  25. input(  6  , 1, 1 ).
  26. input(  6  , 2, 0 ).
  27.  
  28. input(  7  , 1, 0 ).
  29. input(  7  , 2, 1 ).
  30.  
  31. input(  8  , 1, 0 ).
  32. input(  8  , 2, 0 ).
  33.  
  34. input(  9  , 1, 1 ).
  35. input(  9  , 2, 1 ).
  36.  
  37. input(  10 , 1, 1 ).
  38. input(  10 , 2, 0 ).
  39.  
  40. input(  11 , 1, 0 ).
  41. input(  11 , 2, 1 ).
  42.  
  43. input(  12 , 1, 0 ).
  44. input(  12 , 2, 0 ).
  45.  
  46. input(  13 , 1, 1 ).
  47. input(  13 , 2, 1 ).
  48.  
  49. input(  14 , 1, 1 ).
  50. input(  14 , 2, 0 ).
  51.  
  52. input(  15 , 1, 0 ).
  53. input(  15 , 2, 1 ).
  54.  
  55.  
  56. output(  0  , 9, 0 ).
  57. output(  1  , 9, 0 ).
  58. output(  2  , 9, 1 ).
  59. output(  3  , 9, 1 ).
  60.  
  61. output(  4  , 9, 0 ).
  62. output(  5  , 9, 1 ).
  63. output(  6  , 9, 1 ).
  64. output(  7  , 9, 1 ).
  65.  
  66. output(  8  , 9, 0 ).
  67. output(  9  , 9, 0 ).
  68. output(  10 , 9, 1 ).
  69. output(  11 , 9, 1 ).
  70.  
  71. output(  12 , 9, 0 ).
  72. output(  13 , 9, 0 ).
  73. output(  14 , 9, 1 ).
  74. output(  15 , 9, 1 ).
  75.  
  76. %%%%%%%%%%%% network for exclusive or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  77.  
  78. neuron(   input , 1 , $A$  ).
  79. neuron(   input , 2 , $B$  ).
  80. neuron(   not(1) , 3 , $-A$  ).
  81. neuron(   not(2) , 4 , $-B$  ).
  82. neuron(   and    , 5 , $A and B$  ).
  83. neuron(   and    , 6 , $A and -B$  ).
  84. neuron(   and    , 7 , $-A and B$  ).
  85. neuron(   and    , 8 , $-A and -B$  ).
  86. neuron(   or     , 9 , $A exc B$  ).
  87.  
  88. state( edge,  and, 1 , 5, 0, 1).
  89. state( edge,  and, 2 , 5, 0, 1).
  90. state( edge,  and, 3 , 5, 0, 0).
  91. state( edge,  and, 4 , 5, 0, 0).
  92.  
  93. state( edge,  and, 1 , 6, 0, 1).
  94. state( edge,  and, 2 , 6, 0, 0).
  95. state( edge,  and, 3 , 6, 0, 0).
  96. state( edge,  and, 4 , 6, 0, 1).
  97.  
  98. state( edge,  and, 1 , 7, 0, 0).
  99. state( edge,  and, 2 , 7, 0, 1).
  100. state( edge,  and, 3 , 7, 0, 1).
  101. state( edge,  and, 4 , 7, 0, 0).
  102.  
  103. state( edge,  and, 1 , 8, 0, 0).
  104. state( edge,  and, 2 , 8, 0, 0).
  105. state( edge,  and, 3 , 8, 0, 1).
  106. state( edge,  and, 4 , 8, 0, 1).
  107.  
  108. state( edge,  or , 5 , 9, 0, 1).
  109. state( edge,  or , 6 , 9, 0, 1).
  110. state( edge,  or , 7 , 9, 0, 1).
  111. state( edge,  or , 8 , 9, 0, 1).
  112.  
  113.